<template>
  <div class="boxx">
    <div class="below">
      <div class="categories">
        <span style="color: #ff6700;">综合</span>
        <el-divider direction="vertical"></el-divider>
        <span>新品</span>
        <el-divider direction="vertical"></el-divider>
        <span>销售</span>
        <el-divider direction="vertical"></el-divider>
        <span>价格<i class="el-icon-top"></i></span>
      </div>
      <div class="checkboxes">
        <div>
          收货地
          <el-select v-model="value" placeholder="请选择" size="mini">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
        <el-checkbox-group v-model="checkList" size="medium" class="checkbox-group">
          <el-checkbox label="促销"></el-checkbox>
          <el-checkbox label="分期"></el-checkbox>
          <el-checkbox label="仅看有货"></el-checkbox>
        </el-checkbox-group>
      </div>
    </div>
    <div class="ckbox">
      <div class="ckboxs" v-for="item in datas" :key="item.id" @click="getDetailed(item.id)">
        <img :src="item.src" alt="">
        <h3>{{ item.Englishname }}</h3>
        <h2>{{ item.theprice }}</h2>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    datas: {
      type: Array,
    }

  },
  data() {
    return {
      checkList: [],
      options: [
        {
          value: "选项1",
          label: "北京",
        },
        {
          value: "选项2",
          label: "成都",
        },
        {
          value: "选项3",
          label: "重庆",
        },
        {
          value: "选项4",
          label: "上海",
        },
        {
          value: "选项5",
          label: "广东",
        },
      ],
      value: "",
    };
  },
  methods: {
    getDetailed(id) {
      // console.log(id);
      // 触发自定义事件并传递 id
      this.$emit('get-detailed', id);
    },
  }
}
</script>

<style scoped>
.boxx {
  background: #f5f5f5;
  margin-top: 60px;
  width: 100%;
}

.below {
  margin: 0 auto;
  width: 1226px;
  height: 25px;
  padding: 27px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.categories {
  flex: 1;
  padding: 0;
}

.categories span {
  margin-left: 30px;
  cursor: pointer;
}

.categories span:hover {
  color: #ff6700;
}

.checkboxes {
  flex: 1;
  margin-left: 20px;
  display: flex;
  justify-content: center;
}

.checkbox-group {
  margin-left: 20px;
}

.ckbox {
  width: 1240px;
  /* height: 100%; */
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

.ckboxs {
  width: 290px;
  height: 350px;
  margin-right: 16px;
  margin-bottom: 16px;
  text-align: center;
  background: #fff;
  padding-top: 47px;
  transition: box-shadow 1.2s ease;
  cursor: pointer;
}

.ckboxs:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.19);
  /* 添加阴影效果 */
}

.ckboxs img {
  width: 200px;
  height: 200px;
}

.ckboxs h3 {
  padding-top: 16px;
}

.ckboxs h2 {
  padding-top: 16px;
  color: #ff6700;
}

.ckboxs h3:hover {
  color: #ff6700;
}
</style>